package com.kede.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;

import com.kede.ienum.PayTypeEnum;
import com.kede.ienum.order.AuthClearLevelEnum;
import com.kede.ienum.order.OrderStatusEnum;
import com.kede.ienum.order.PayStatusEnum;
import com.kede.typehanlder.PayTypeEnumTypeHanlder;
import com.kede.typehanlder.order.AuthClearLevelEnumTypeHanlder;
import com.kede.typehanlder.order.OrderStatusEnumTypeHanlder;
import com.kede.typehanlder.order.PayStatusEnumTypeHanlder;
import lombok.Builder;
import lombok.Data;

import javax.annotation.Generated;

/**
 * 订单表
 * @TableName sy_leescore_order
 */
@TableName(value ="sy_leescore_order")
@Data
@Builder
public class LeescoreOrderDomain implements Serializable {
    /**
     * 订单ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户ID
     */
    @TableField(value = "uid")
    private Integer uid;

    /**
     * 收货地址
     */
    @TableField(value = "address_id")
    private Integer addressId;

    /**
     * 订单号
     */
    @TableField(value = "order_id")
    private String orderId;

    /**
     * 回执单号
     */
    @TableField(value = "trade_id")
    private String tradeId;

    /**
     * 创建时间
     */
    @TableField(value = "createtime",fill = FieldFill.INSERT)
    private Integer createtime;

    /**
     * NOPAY(0,"未付款"),
    PAY(1,"已付款"),
    BACKED(2,"已退回");
     */
    @TableField(value = "pay",typeHandler = PayStatusEnumTypeHanlder.class)
    private PayStatusEnum pay;

    /**
     * NOPAY(0,"待付款"),
    SEND(1,"待发货"),
    RECEIVEING(2,"待收货"),
    RECEIVE(3,"已签收"),
    FINISH(-1,"已完成");
     */
    @TableField(value = "status",typeHandler = OrderStatusEnumTypeHanlder.class)
    private OrderStatusEnum status;

    /**
     * 付款时间
     */
    @TableField(value = "paytime")
    private Integer paytime;

    /**
     * 支付方式:score=积分支付,money=余额支付
     */
    @TableField(value = "paytype",typeHandler = PayTypeEnumTypeHanlder.class)
    private PayTypeEnum paytype;

    /**
     * 1
     */
    @TableField(value = "isdel")
    private Integer isdel;

    /**
     * 备注
     */
    @TableField(value = "other")
    private String other;

    /**
     * 虚拟券序列号/快递单号
     */
    @TableField(value = "virtual_sn")
    private String virtualSn;

    /**
     * 虚拟券名称/物流公司
     */
    @TableField(value = "virtual_name")
    private String virtualName;

    /**
     * 发货时间
     */
    @TableField(value = "virtual_go_time")
    private Integer virtualGoTime;

    /**
     * 签收时间
     */
    @TableField(value = "virtual_sign_time")
    private Integer virtualSignTime;

    /**
     * 支付积分
     */
    @TableField(value = "score_total")
    private BigDecimal scoreTotal;

    /**
     * 支付货币
     */
    @TableField(value = "money_total")
    private BigDecimal moneyTotal;

    /**
     * 回馈备注
     */
    @TableField(value = "result_other")
    private String resultOther;

    /**
     * 实际支付积分
     */
    @TableField(value = "trade_score")
    private BigDecimal tradeScore;

    /**
     * 实际付款
     */
    @TableField(value = "trade_money")
    private BigDecimal tradeMoney;

    /**
     * 实际付款时间
     */
    @TableField(value = "trade_time")
    private String tradeTime;

    /**
     * 自动清理:0=清理,1=不清理
     */
    @TableField(value = "auth_clear_level",typeHandler = AuthClearLevelEnumTypeHanlder.class)
    private AuthClearLevelEnum authClearLevel;

    /**
     * 订单处理结果
     */
    @TableField(value = "pay_msg")
    private String payMsg;

    /**
     * 
     */
    @TableField(value = "weigh")
    private Integer weigh;

    /**
     * 
     */
    @TableField(value = "updatetime",fill = FieldFill.INSERT_UPDATE)
    private Integer updatetime;

    /**
     * 有效期截止时间 秒
     **/
    @TableField(value = "effect_time")
    private Integer effectTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        LeescoreOrderDomain other = (LeescoreOrderDomain) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUid() == null ? other.getUid() == null : this.getUid().equals(other.getUid()))
            && (this.getAddressId() == null ? other.getAddressId() == null : this.getAddressId().equals(other.getAddressId()))
            && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getTradeId() == null ? other.getTradeId() == null : this.getTradeId().equals(other.getTradeId()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()))
            && (this.getPay() == null ? other.getPay() == null : this.getPay().equals(other.getPay()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getPaytime() == null ? other.getPaytime() == null : this.getPaytime().equals(other.getPaytime()))
            && (this.getPaytype() == null ? other.getPaytype() == null : this.getPaytype().equals(other.getPaytype()))
            && (this.getIsdel() == null ? other.getIsdel() == null : this.getIsdel().equals(other.getIsdel()))
            && (this.getOther() == null ? other.getOther() == null : this.getOther().equals(other.getOther()))
            && (this.getVirtualSn() == null ? other.getVirtualSn() == null : this.getVirtualSn().equals(other.getVirtualSn()))
            && (this.getVirtualName() == null ? other.getVirtualName() == null : this.getVirtualName().equals(other.getVirtualName()))
            && (this.getVirtualGoTime() == null ? other.getVirtualGoTime() == null : this.getVirtualGoTime().equals(other.getVirtualGoTime()))
            && (this.getVirtualSignTime() == null ? other.getVirtualSignTime() == null : this.getVirtualSignTime().equals(other.getVirtualSignTime()))
            && (this.getScoreTotal() == null ? other.getScoreTotal() == null : this.getScoreTotal().equals(other.getScoreTotal()))
            && (this.getMoneyTotal() == null ? other.getMoneyTotal() == null : this.getMoneyTotal().equals(other.getMoneyTotal()))
            && (this.getResultOther() == null ? other.getResultOther() == null : this.getResultOther().equals(other.getResultOther()))
            && (this.getTradeScore() == null ? other.getTradeScore() == null : this.getTradeScore().equals(other.getTradeScore()))
            && (this.getTradeMoney() == null ? other.getTradeMoney() == null : this.getTradeMoney().equals(other.getTradeMoney()))
            && (this.getTradeTime() == null ? other.getTradeTime() == null : this.getTradeTime().equals(other.getTradeTime()))
            && (this.getAuthClearLevel() == null ? other.getAuthClearLevel() == null : this.getAuthClearLevel().equals(other.getAuthClearLevel()))
            && (this.getPayMsg() == null ? other.getPayMsg() == null : this.getPayMsg().equals(other.getPayMsg()))
            && (this.getWeigh() == null ? other.getWeigh() == null : this.getWeigh().equals(other.getWeigh()))
            && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUid() == null) ? 0 : getUid().hashCode());
        result = prime * result + ((getAddressId() == null) ? 0 : getAddressId().hashCode());
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getTradeId() == null) ? 0 : getTradeId().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        result = prime * result + ((getPay() == null) ? 0 : getPay().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getPaytime() == null) ? 0 : getPaytime().hashCode());
        result = prime * result + ((getPaytype() == null) ? 0 : getPaytype().hashCode());
        result = prime * result + ((getIsdel() == null) ? 0 : getIsdel().hashCode());
        result = prime * result + ((getOther() == null) ? 0 : getOther().hashCode());
        result = prime * result + ((getVirtualSn() == null) ? 0 : getVirtualSn().hashCode());
        result = prime * result + ((getVirtualName() == null) ? 0 : getVirtualName().hashCode());
        result = prime * result + ((getVirtualGoTime() == null) ? 0 : getVirtualGoTime().hashCode());
        result = prime * result + ((getVirtualSignTime() == null) ? 0 : getVirtualSignTime().hashCode());
        result = prime * result + ((getScoreTotal() == null) ? 0 : getScoreTotal().hashCode());
        result = prime * result + ((getMoneyTotal() == null) ? 0 : getMoneyTotal().hashCode());
        result = prime * result + ((getResultOther() == null) ? 0 : getResultOther().hashCode());
        result = prime * result + ((getTradeScore() == null) ? 0 : getTradeScore().hashCode());
        result = prime * result + ((getTradeMoney() == null) ? 0 : getTradeMoney().hashCode());
        result = prime * result + ((getTradeTime() == null) ? 0 : getTradeTime().hashCode());
        result = prime * result + ((getAuthClearLevel() == null) ? 0 : getAuthClearLevel().hashCode());
        result = prime * result + ((getPayMsg() == null) ? 0 : getPayMsg().hashCode());
        result = prime * result + ((getWeigh() == null) ? 0 : getWeigh().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", uid=").append(uid);
        sb.append(", addressId=").append(addressId);
        sb.append(", orderId=").append(orderId);
        sb.append(", tradeId=").append(tradeId);
        sb.append(", createtime=").append(createtime);
        sb.append(", pay=").append(pay);
        sb.append(", status=").append(status);
        sb.append(", paytime=").append(paytime);
        sb.append(", paytype=").append(paytype);
        sb.append(", isdel=").append(isdel);
        sb.append(", other=").append(other);
        sb.append(", virtualSn=").append(virtualSn);
        sb.append(", virtualName=").append(virtualName);
        sb.append(", virtualGoTime=").append(virtualGoTime);
        sb.append(", virtualSignTime=").append(virtualSignTime);
        sb.append(", scoreTotal=").append(scoreTotal);
        sb.append(", moneyTotal=").append(moneyTotal);
        sb.append(", resultOther=").append(resultOther);
        sb.append(", tradeScore=").append(tradeScore);
        sb.append(", tradeMoney=").append(tradeMoney);
        sb.append(", tradeTime=").append(tradeTime);
        sb.append(", authClearLevel=").append(authClearLevel);
        sb.append(", payMsg=").append(payMsg);
        sb.append(", weigh=").append(weigh);
        sb.append(", updatetime=").append(updatetime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}